/*
 * @Author: dapeng
 * @Date: 2020-07-17 15:15:56
 * @LastEditTime: 2022-09-09 08:56:51
 * @LastEditors: Symbol_Yang
 * @Description:图片验证码
 * @FilePath: /tengserver/src/user/services/captcha.js
 */ 


'use strict'
const config = require('config')
const svgCaptcha = require('svg-captcha')


/**
 * 初始化
 */
class CaptchaService {
    constructor() {

    }

    async getCaptcha() {
        let captcha = svgCaptcha.create({
            size: 4,
            fontSize: 50,
            noise: 2,
            width: 120,
            height: 34,
            // 忽略字符
            ignoreChars: "AaBbCcDdEeFfGgHhIiKkLlJjMmNnOoPpQqRrSsTtUuVvWwXxYyZz",
            background: "#cc9966"
        })
        return captcha
    }

}

module.exports = new CaptchaService()